package com.wrx.club_management_backend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wrx.club_management_backend.common.CommonEntity;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("tb_comment")
public class Comment extends CommonEntity {

    @TableId(type = IdType.AUTO)
    private Long id;

    private Long newsId;

    private Long userId;

    private String nickname;

    private String avatar;

    private String content;

    private int likes;

    /*
        1 根评论
        0 不是跟评论
     */
    private int isRoot;

    /**
     * 根评论id
     */
    private Long parentId;

    private String replyTo;

    @TableField(exist = false)
    private List<Comment> replies;
}
